package com.lwh.springboot.controller;

import com.lwh.springboot.pojo.vo.CarTypeCountVO;
import com.lwh.springboot.service.ICarTypeService;
import com.lwh.springboot.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/echarts")
public class EchartsController {
    @Autowired
    private ICarTypeService carTypeService;

    @RequestMapping("/toEcharts")
    public String toEcharts(){
        return "echarts";
    }
    @RequestMapping("/selectCarTypeCount")
    @ResponseBody
    public Result selectCarTypeCount(){
        List<CarTypeCountVO> list=carTypeService.selectCarTypeCount();
        return Result.ok(list);
    }
}
